<{include file="Public/top.html"}>
</head>
<body>
<div id="warpper">
    <div class="content">
        <div class="location">商户管理</div>

        <div class="ui-tab">
            <ul>
                <li class="tab-item <{if $action eq 'restaurantList' }> selected <{/if}>"><a href="<{u('restaurantList')}>" onclick="LayerShow();">商户管理</a></li>
                <li class="tab-item <{if $action eq 'storeList' }> selected <{/if}>"><a href="<{u('storeList')}>" onclick="LayerShow();">门店管理</a></li>
                <li class="tab-item <{if $action eq 'verificationList' }> selected <{/if}>"><a href="<{u('verificationList')}>" onclick="LayerShow();">核销员</a></li>
                <li class="tab-item <{if $action eq 'storePackage' }> selected <{/if}>"><a href="<{u('storePackage')}>" onclick="LayerShow();">商品套餐</a></li>
                <li class="tab-item <{if $action eq 'monthRecord' }> selected <{/if}>"><a href="<{u('monthRecord')}>" onclick="LayerShow();">月统计</a></li>
            </ul>
        </div>




        <div class="filedSet" style="padding-bottom: 0;">
            <div class="search">
                <form action="" method="get" class="ui-form reportForm" id="searchForm">
                    <input name="m" type="hidden" value="<{$module}>">
                    <input name="c" type="hidden" value="<{$controller}>">
                    <input name="a" type="hidden" value="<{$action}>">

                    <input name="p" id="page" type="hidden" value="<{$page|default:1}>">
                    <input name="limit" id="limit" type="hidden" value="<{$limit|default:10}>">
                    <input name="ofield" id="ofield" type="hidden" value="<{$ofield}>">
                    <input name="otype"  id="otype"  type="hidden" value="<{$otype}>">

                    <div class="ui-form-item inline-block">
                        <label class="ui-label">所属商户</label>
                        <select name="id" class="ui-select" style="width: 160px;">
                            <option value="0">全部</option>
                            <{html_options options=$restaurantKv selected=$id}>

                        </select>
                    </div>
                    <div class="ui-form-item inline-block">
                        <label class="ui-label">关键字</label>
                        <input type="text" name="keyword" value="<{$keyword}>" class="ui-text bg-text keyword" placeholder="商户／门店" />
                    </div>
                    <div class="ui-form-item inline-block">
                        <button type="submit" class="ui-button" onclick="LayerShow();">查询</button>
                    </div>
                    <div class="ui-form-item inline-block" style="display: none;">
                        <button type="button" id="addStoreBtn" class="ui-button" onclick="LayerShow();">添加门店</button>
                    </div>
                </form>
            </div>
        </div>
        <!--表格内容-->
        <div class="mainGrid">
            <table class="ui-table ui-body">
                <thead>
                <tr>
                    <th class="pct15">商户名</th>
                    <th class="pct15">门店名</th>
                    <th class="pct20">门店地址</th>
                    <th class="pct10">核销员数量</th>
                    <th class="pct10">评论数量</th>
                    <th class="pct10">卡券种类</th>
                    <th class="pct10">发放数量</th>
                    <th class="pct10">核销数量</th>
                    <th class="pct10">核销率</th>
                    <th class="pct20 last-col">操作</th>
                </tr>
                </thead>
                <tbody>
                <{foreach from=$list item=item}>
                <tr>
                    <td><{$item.restaurantName}></td>
                    <td><{$item.storeName}></td>
                    <td><{$item.address}></td>
                    <td><{$item.verificationNum}></td>
                    <td><a style="color:#2077d1;" href="<{u('comment/index?objType='|cat:$smarty.const.OBJ_TYPE_STORE)|cat:'&objID='|cat:$item['id']}>"><{$item['commentNum']}></a></td>
                    <td><{$item.cardinfoNum}></td>
                    <td><{$item.launchNum}></td>
                    <td><{$item.consume_num}></td>
                    <td><{$item.consume_percent}>%</td>
                    <td class="ta_l">
                        <div class="handler">
                            <a href="<{u('storeEdit/?id='|cat:$item['id'])}>" onclick="LayerShow();">修改</a>
                            <span class="sep">|</span>
                            <a href="<{u('verificationAdd/?id='|cat:$item['id'])|cat:'&rid='|cat:$item['restaurantId']}>" onclick="LayerShow();">核销员</a>
                            <span class="sep">|</span>
                            <{if $item.status == $smarty.const.ENABLE_ENABLE}>
                            <a href="<{u('storeUpdate/?id='|cat:$item['id'])}>" onclick="if(!confirm('确定不启用该商户么？'))return false;">已启用</a>
                            <{else}>
                            <a href="<{u('storeUpdate/?id='|cat:$item['id'])}>" onclick="if(!confirm('确定启用该商户么？'))return false;">未启用</a>
                            <{/if}>
                        </div>
                    </td>
                </tr>
                <{/foreach}>
                </tbody>
            </table>
        </div>
        <!--描述：分页-->
        <div class="pagination">
            <{include file="Public/page.html"}>
        </div>

    </div>
</div>
<script>
    $('#syncStoreBtn').click(function(){
        $.getJSON("<{U('syncStore')}>",function(result){
            layer.msg(result.msg);
            if(result.status==0){}
        });
    });
    $('#addStoreBtn').click(function(){
        location.href="<{u('storeAdd')}>";
    });
</script>
</body>
<{include file="Public/foot.html" }>